/*
 * @Author: HZK
 * @Date: 2020-08-25 11:30:36
 * @LastEditTime: 2020-08-26 13:38:00
 * @LastEditors: hanfengmi
 * @Description: 
 */
// import MyPromise1 from './MyPromise1' 
// import MyPromise2 from './MyPromise2' 
// import MyPromise3 from './MyPromise3' 
// import MyPromise4 from './MyPromise4' 
// import MyPromise5 from './MyPromise5' 
// import MyPromise6 from './MyPromise6' 
// import MyPromise7 from './MyPromise7' 
import MyPromise8 from './MyPromise8' 

// const promise = new Promise((resolve,reject)=>{
//     resolve('成功')
//     // reject('失败')
// })
// var pp = promise.then(result=>{
//     console.log('success',result)
//     return pp
// },reason=>{
//     console.log('error',reason)
// }).then(undefined,(reason)=>{
//     console.log('error',reason.message)
// })


const p1 = new MyPromise8((resolve,reject)=>{
    resolve('success 嘀嘀嘀')
    // throw new Error('xixixi')
    // reject('error 嘀嘀嘀')

    // setTimeout(()=>{
    //     // reject('error timeout 嘀嘀嘀')
    //     resolve('success timeout 嘀嘀嘀')
    // },2000)
})


// function other (){
//     return new MyPromise6((resolve,reject)=>{
//         resolve('other success 嘀嘀嘀')
//     })
// } 

// var p2 = p1.then(result=>{
//     console.log(123123,result)
//     return p2;
// })
// p2.then(result=>{
//     console.log(result)
// },reason=>{
//     console.log(111111,reason.message)
// })

p1.then().then().then().then(value=> console.log(value))




